/**
 *  到期剩余天数
 * @param {*} expireTime 到期时间
 * @param {*} serverTime 服务器时间戳
 * @returns
 */
export function getLeftDay (expireTime, serverTime) {
  if (!expireTime) {
    return 0
  }
  if (typeof expireTime === 'string') {
    expireTime = parseInt(new Date(expireTime).getTime() / 1000)
  }
  if (expireTime <= serverTime) {
    return 0
  } else {
    return Math.ceil((expireTime - serverTime) / (60 * 60 * 24))
  }
}

export const kefuQQ = '2791477506'
export const email = 'service@kangaroooffice.com '
export const pkgByCid = {
  '10001': ['10000'], // 整理
  '10002': [], // 壁纸
  '10003': ['20000'], // 待办
  '10004': ['40000'], // 搜搜
  '10005': ['70000'], // 独立壁纸
  '10006': ['100000'] // 海外整理
}
export function getCidByPkg (pkg_id) {
  const keys = Object.keys(pkgByCid)
  return keys.find(item => {
    if (pkgByCid[item].includes(pkg_id)) {
      return item
    }
  })
}

// 皮肤中心 桌面主题和壁纸兼容的最低版本
export const minVersionMenu = '3.1.6.17'
